@extends('admin/layout/index')

@section('css')
	<link rel="stylesheet" href="/views/css/page_page.css">
@endsection

@section('content')
<div class="mws-panel grid_8">
	<div class="mws-panel-header">
			<span><i class="icon-table"></i>商品管理</span>
	</div>
		<div class="mws-panel-body no-padding">
			<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
				<div id="DataTables_Table_1_length" class="dataTables_length">
				<form action="/admin/goods/index" method="get">
					<label>显示 
						<select size="1" name="count" aria-controls="DataTables_Table_1">
						<option value="10" @if(!empty($request['count']) && $request['count'] == 10) selected @endif>10</option>
						<option value="25" @if(!empty($request['count']) && $request['count'] == 25) selected @endif>25</option>
						<option value="50" @if(!empty($request['count']) && $request['count'] == 50) selected @endif>50</option>
						<option value="100" @if(!empty($request['count']) && $request['count'] == 100) selected @endif>100</option>
						</select>条
					</label>
				</div>
				<div class="dataTables_filter" id="DataTables_Table_1_filter" >
					<label>关键字 
						<input type="text" value="{{$request['search'] or ''}}" name="search" aria-controls="DataTables_Table_1">
						<input type="submit" value="搜索">
					</label>
				</div>
			</form>
			<table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
				<thead>
					<tr role="row">
						<th class="sorting"  style="width: 194px;">id</th>
						<th class="sorting"  style="width: 194px;">商品名称</th>
						<th class="sorting"  style="width: 194px;">商品价格</th>
						<th class="sorting"  style="width: 194px;">商品图像</th>
						<th class="sorting"  style="width: 194px;">商品库存</th>
						<th class="sorting"  style="width: 194px;">商品销量</th>
						<th class="sorting"  style="width: 194px;">商品描述</th>
						<th class="sorting"  style="width: 194px;">商品类型</th>
						<th class="sorting"  style="width: 194px;">商品状态</th>
						<th class="sorting"  style="width: 194px;">操作</th>
					</tr>
				</thead>
				<tbody role="alert" aria-live="polite" aria-relevant="all">
				@foreach($data as $k => $v)
				<tr class="odd">
				    <td class=" ">{{ $v['gid']}}</td>
				    <td class=" ">{{ $v['gname']}}</td>
				    <td class=" ">{{ $v['gprice']}} 元</td>
				    <td > @if(!empty( $v['gpic'] )) <img src="/upload/{{ $v['gpic'] }}" alt="" width="80px"> @endif</td>
				    <td class=" ">{{ $v['gcount']}}</td>
				    <td class=" ">{{ $v['gsold']}}</td>
				    <td class=" ">{!! $v['gdesc'] !!}</td>
				    <td class=" ">{{ $v['cid']}}</td>
				    <td class=" ">{{ $v['gdesc']}}</td>
				    <td class=" ">
				    	<a href="/admin/goods/delete/" style="color:black;font-size:20px;margin:15px" title="下架" onclick="return confirm('确认下架吗？')"><i class="icon-arrow-down-3"></i></a>
			        	<a href="/admin/goods/edit/" style="color:black;font-size:20px;margin:15pxfloat:left" title="上架"><i class="icon-arrow-up-3"></i></a>
				    </td>
				</tr>
				@endforeach
				</tbody>
			</table>
			<div class="dataTables_info" id="DataTables_Table_1_info">Showing 1 to 10 of 57 entries</div>
			 <div class="dataTables_paginate paging_full_numbers" id="page_page">
		    	{!! $data-> appends($request)->render() !!}
		    </div>
		</div>
	</div>
</div>
@endsection